<?php
namespace app\adminapi\controller\setting\user;

use app\adminapi\{
    controller\BaseAdminApiController,
    logic\setting\user\UserLogic,
    validate\setting\UserConfigValidate
};

/**
 * 设置-用户设置控制器
 * Class UserController
 * @package app\adminapi\controller\config
 */
class UserController extends BaseAdminApiController
{

    /**
     * @notes 获取用户设置
     * @return \support\Response
     */
    public function getConfig()
    {
        $result = (new UserLogic())->getConfig();
        return $this->data($result);
    }


    /**
     * @notes 设置用户设置
     * @return \support\Response
     */
    public function setConfig()
    {
        $params = (new UserConfigValidate())->post()->goCheck('user');
        (new UserLogic())->setConfig($params);
        return $this->success('操作成功', [], 1, 1);
    }

}